<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <script>
        let arr = [1, 45, 45, 485, 48, 78];
        Array.prototype.inOf = function (num) {
            // console.log(this);
            let nul =  -1
            for (let i = 0; i < this.length; i++) {
                // console.log(i);
                if (num === this[i]) {
                    return i
                }
            }
            return nul
        }
        // arr.inOf(45)
        console.log(arr.inOf(2));


    </script>
</body>

</html>